package text;
import java.util.Scanner;
public class qushuzi {
			public static void main(String[] args)
			{	Scanner in = new Scanner(System.in);
			    while(true)
			    {
			    	
				    // get first input
				    //System.out.print("n");
				    String a = in.nextLine();
				    int n = Integer.parseInt(a);
				    int i,j,r=0;
				    int [] k=new int[100];
				    //int m1[] = null;int m2[] = null;int m3[] = null;
			    	if((n>=1000)&&(n<=20000))
			    	{
			    		
			    		System.out.println(Integer.toBinaryString(n)+","+Integer.toOctalString(n)+","+Integer.toHexString(n));
			    	}
			    	else
			    	{
			    		if(n<0)n=(-1)*n;
			    		for(i=0;n>9;i++)
			    		{
			    			k[i]=n%10;
			    			n=n/10;
			    			r=k[i]+r;
			    		}
			    		k[i]=n;
			    		r=k[i]+r;
			    		String s="";
			    		for(j=0;j<a.length();j++)
			    		{
			    			if(a.charAt(j)!='-')
			    			s=s+a.charAt(j)+" ";
			    			
			    		}
			    		System.out.println(s+r);
			    	}

			    }
			}
		}
